Present invention relates to an image encoding and decoding apparatus for encoding and decoding an inputted image and performing a rotation process on the inputted image.
Conventionally, a method where an image is encoded in a raster unit is often utilized for encoding a black or white binary image. For instance, the MH, MR and MMR methods which are utilized as encoding methods in a facsimile apparatus perform encoding operation depending upon a length of continuous black pixels or white pixels (run length). In an image communication apparatus adopting such encoding method, when an image is to be rotated in 90-degree unit, rotation operation must be performed after an encoded image is decoded to an original image, or before the encoding process is performed.
When encoding is performed by the conventional encoding apparatus, an original document is placed widthwisely (scanning direction is lengthwise) and an image on the original document is read pixel by pixel in the scanning direction.
In the conventional apparatus, the image is sequentially stored in a page memory in accordance with the scanning direction of the original document. Reading operation for encoding a rotated image is performed in a scanning direction different from the direction of the aforementioned storing operation.
In the conventional apparatus, an encoder used for storing image data and a memory, serve as a buffer memory for e.g. performing transmission of facsimile data stored in a memory, or for communicating between facsimile apparatuses each having a different protocol. During communication, encoded data for storage is read from the memory, encoded by the encoder used for storing image data, modulated for transmission by an encoder used for transmission and transmitted. Meanwhile, the transmitted data is decoded by a decoder used for transmission at a receiver's side and printed out on a lengthwisely-placed paper (on which scanning is performed widthwisely).
Conventionally, in order to rotate the scanned image by 90 degrees and encode the rotated image in a raster sequence, it is necessary to temporarily store the entire image in a page memory for rotation, and change the sequence of reading, thereby encoding the image.
Moreover, as an encoding method without requiring a rotation memory, a method is suggested where an image is encoded in a small block unit. However, even if encoding is performed in a small block unit based on run length, each of the run length is short in such encoding method; therefore, compression rate of an image is not improved. The encoding method of encoding an image in a block unit includes a fixed-length encoding method and a variable-length encoding method. In case of encoding by the fixed-length encoding method, a block-unit code can be randomly accessed, however, when comparing it with encoding by the variable-length encoding method for obtaining the same compression rate, image deterioration is significant.
On the other hand, in case of the variable-length encoding method, image deterioration is not so noticeable; but in order to access codes by changing sequences of blocks, head addresses of the block codes must be stored separately. The amount of data for storing the addresses is calculated by a number of blocks.times.a number of bits (16 to 32 bit) required for addressing/8 [bytes]. This raises a problem that the amount of data grows to an undesirable size when the image size becomes large.
FIG. 20 shows an operation executed by a conventional facsimile apparatus. Standardization for the conventional facsimile apparatus (501), specifies only a lengthwise feeding of an original document or a recording sheet (503 in FIG. 20) having the size of either A4 or B4. Therefore, in the case where a received image having the size of A4 is to be printed out by a facsimile apparatus (502) capable of printing data on a print sheet of A3 size (i.e. the facsimile having a printer capable of feeding a recording sheet of A4 side sideways), the received image must be reduced 70% so that the entire image can be printed on one recording sheet of A4 size which is fed sideways (504 in FIG. 20). Alternatively, received and decoded image data must be written in a page memory and by controlling the memory access, the written image must be rotated 90 degrees to be printed on the sheet (505 in FIG. 20).